<?php

/**
 * This is the model class for table "goods_hotel".
 *
 * The followings are the available columns in table 'goods_hotel':
 * @property integer $id ID
 * @property integer $uid 用户
 * @property integer $hotel_id 酒店
 * @property integer $goods_id 商品id
 * @property string $room_type 房间类型
 * @property integer $has_breakfast 含早餐
 * @property integer $breakfast_type 早餐
 * @property integer $bed_type 床型
 * @property string $floor 楼层
 * @property integer $no_smoking 无烟房
 * @property integer $broadband_type 宽带
 * @property integer $bed_additional 加床
 * @property integer $bathroom_type 卫浴
 * @property integer $num 房间数量
 * @property string $notes 预定须知
 * @property string $info 房间信息
 */
class GoodsHotel extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return GoodsHotel the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.GoodsHotelMetadata';
	}
	
	public function getBreakfast() {
		if ($this->has_breakfast) {
			return Yii::app()->enum->lookup('goods.breakfastType',$this->breakfast_type);
		}
		return '否';
	}
}